import request from '@/utils/request'

export const tagTableList = params => {
  return request({
    url: '/admin/customerTagRule/queryTagRule',
    method: 'get',
    params
  })
}

export const tagInfo = params => {
  return request({
    url: '/admin/customerTagRule/getDetailInfo',
    method: 'get',
    params
  })
}

export const groupList = (params = {}) => {
  return request({
    url: '/admin/group/list',
    method: 'get',
    params
  })
}

export const tagList = params => {
  return request({
    url: '/admin/type/list',
    method: 'get',
    params
  })
}

export const createTag = data => {
  return request({
    url: '/admin/customerTagRule/createTagRule',
    method: 'post',
    data,
  })
}

export const updateTag = data => {
  return request({
    url: '/admin/customerTagRule/updateTagRule',
    method: 'post',
    data
  })
}

export const updateTagState = params => {
  return request({
    url: '/admin/customerTagRule/calculateTagRule',
    method: 'get',
    params
  })
}

export const deleteTag = params => {
  return request({
    url: '/admin/customerTagRule/removeTagRule',
    method: 'get',
    params
  })
}

export const caculation = data => {
  return request({
    url: '/admin/customerTagRule/caculation',
    method: 'post',
    data
  })
}

export const searchCalTagDeatil = params => {
  return request({
    url: '/admin/customerTagRule/searchCalTagDeatil',
    method: 'get',
    params
  })
}
